Using a Classifier (Single-ROI Example)
This tutorial walks you through creating your first classification model on the OV20i camera system. You'll learn to set up a single Region of Interest (ROI) classifier to automatically identify and categorize different types of objects - in this example, different sizes of drill bits.
What You'll Build: A working classification model that can automatically identify and sort different drill bit sizes with configurable pass/fail logic.
Estimated Time: 45-60 minutes
Skill Level: Beginner
Prerequisites: OV20i camera system set up and connected
Step 1: Create a New Classification Recipe
1.1 Access Recipe Creation
- Navigate to All Recipes page in your OV20i interface
- Click
+ New Recipe
in the top-right corner
1.2 Configure Recipe Settings
The Add A New Recipe modal will appear:
- Enter Recipe Name: Use a descriptive name like "Drill_Bit_Classification_v1"
- Naming Tip: Include the object type and version for easy identification
- Select Recipe Type: Choose "Classification" from the dropdown menu
- Click
OK
to create the recipe
1.3 Activate the Recipe
- Locate your new recipe in the All Recipes list (it will show as "Inactive")
- Click
Actions > Activate
on the right side of the recipe entry - Click
Activate
to confirm
✅ Checkpoint: Your recipe should now appear as "Active" in the recipe list.
Step 2: Access the Recipe Editor
2.1 Enter Edit Mode
- Click
Edit
next to your active recipe - Click
Open Editor
to confirm and launch the recipe editor
You'll now see the Recipe Editor interface with multiple configuration sections.
Step 3: Configure Camera Imaging Settings
3.1 Open Imaging Configuration
- Click
Configure Imaging
in the lower left-hand side of the Recipe Editor
3.2 Adjust Focus Settings
Focus is critical for accurate classification:
- Position your drill bits in the camera's field of view
- Adjust Focus using either:
- The slider control, OR
- Manual value entry
- Test different focus positions until drill bit edges are sharp and clear
Focus Tips:
- Use the live preview to see focus changes in real-time
- Focus on the most important features (drill bit flutes, tip geometry)
- Ensure the entire depth of your objects is in focus
3.3 Optimize Exposure Settings
Proper exposure ensures consistent image quality:
- Adjust Exposure using the slider or manual entry
- Aim for balanced lighting where:
- Object details are clearly visible
- No areas are overexposed (pure white)
- Shadows don't obscure important features
3.4 Configure LED Lighting
Lighting significantly impacts classification accuracy:
- Select LED Light Pattern based on your objects:
- Bright Field: General purpose illumination
- Dark Field: Highlights edges and surface defects
- Side Lighting: Reveals texture and height variations
- For drill bits, try:
- Bright field for general shape classification
- Side lighting to emphasize flute geometry
3.5 Adjust Gamma Settings
Gamma controls image contrast:
- Adjust Gamma to enhance feature visibility
- Lower values brighten dark areas
- Higher values increase contrast
3.6 Save Imaging Settings
- Review all settings in the live preview
- Click
Save Imaging Settings
to apply configuration
✅ Checkpoint: Your camera should now produce consistent, well-lit images of your drill bits.
Step 4: Configure Template Image and Alignment
4.1 Navigate to Alignment
- Click "Template Image and Alignment" in the breadcrumb menu, OR
- Use the dropdown menu to select "Template Image and Alignment"
4.2 Skip Aligner (For This Tutorial)
Since drill bits will be placed consistently:
- Select
Skip Aligner
- Click
Save
to apply changes
When to Use Aligner: Use the aligner when parts arrive in varying positions or orientations. For this tutorial, we assume consistent part placement.
Step 5: Set Up Inspection ROI
5.1 Navigate to Inspection Setup
- Click "Inspection Setup" in the breadcrumb menu
5.2 Define Region of Interest
The ROI defines where classification will occur:
- Position a drill bit in the camera view
- Drag the ROI corners to frame the drill bit
- Ensure the ROI:
- Completely contains the drill bit
- Excludes unnecessary background
- Is large enough for your largest drill bit variant
5.3 ROI Best Practices
Do | Don't |
---|---|
Include all important features | Make ROI too large (includes noise) |
Leave small border around object | Cut off parts of the object |
Center the expected object position | Include multiple objects in one ROI |
Keep consistent ROI size across images | Change ROI between captures |
5.4 Save ROI Configuration
- Verify ROI positioning with different drill bit sizes
- Click
Save
to apply ROI settings
Checkpoint: Your ROI should consistently frame drill bits regardless of their specific size.
Step 6: Train Classification Model
6.1 Navigate to Classification Block
- Click "Classification Block" in the breadcrumb menu
6.2 Create Classification Classes
You'll create classes for different drill bit sizes:
Example Classes:
- Small Bits (1-3mm)
- Medium Bits (4-6mm)
- Large Bits (7-10mm)
6.3 Capture Training Images
For each class, capture at least 5 different images:
Class 1: Small Bits
- Place a small drill bit in the ROI
- Click capture to take training image
- Label the image as "Small"
- Repeat with 4 more small bits (different orientations/positions)
Class 2: Medium Bits
- Place a medium drill bit in the ROI
- Capture and label as "Medium"
- Repeat 4 more times with different medium bits
Class 3: Large Bits
- Place a large drill bit in the ROI
- Capture and label as "Large"
- Repeat 4 more times with different large bits
6.4 Training Image Best Practices
Best Practice | Why Important |
---|---|
Use different examples | Improves model generalization |
Vary orientations | Handles real-world positioning variation |
Include edge cases | Better boundary detection between classes |
Maintain consistent lighting | Reduces lighting-dependent errors |
5+ images minimum | Provides sufficient training data |
6.5 Review and Verify Labels
- Double-check all labeled images
- Ensure correct class assignments
- Remove any incorrectly labeled examples
6.6 Start Model Training
- Click
Train Classification Model
- Choose training mode:
- Fast: Quick training for testing (2-5 minutes)
- Accurate: Production-quality training (10-20 minutes)
- Select iteration count:
- More iterations = Better accuracy
- More iterations = Longer training time
- Click
Start Training
6.7 Monitor Training Progress
The training progress modal shows:
- Current iteration number
- Training accuracy percentage
- Estimated completion time
Training Controls:
- Abort Training: Stop training if needed
- Finish Training Early: Stop when accuracy is sufficient
Training Tips:
- Training automatically stops when target accuracy is reached
- 85%+ accuracy is typically good for production use
- You can retrain with more images if accuracy is low
✅ Checkpoint: Your model should achieve >85% training accuracy.
Step 7: Test Your Classifier
7.1 Access Live Preview
- Click
Live Preview
after training completes - Place different drill bits in the ROI
- Observe classification results:
- Predicted class name
- Confidence percentage
- Classification timing
7.2 Validation Testing
Test each class systematically:
Test Type | Expected Result | Action if Failed |
---|---|---|
Known Small Bit | Classified as "Small" >80% confidence | Add more training images |
Known Medium Bit | Classified as "Medium" >80% confidence | Review labeling accuracy |
Known Large Bit | Classified as "Large" >80% confidence | Retrain with more examples |
Empty ROI | No classification or low confidence | Adjust confidence thresholds |
7.3 Troubleshooting Classification Issues
Problem | Possible Causes | Solutions |
---|---|---|
Low confidence | Insufficient training data | Add more training images |
Wrong classifications | Poor image quality | Improve lighting/focus |
Inconsistent results | ROI includes background noise | Reduce ROI size |
Classes confused | Similar-looking objects | Add more distinguishing examples |
Step 8: Configure Pass/Fail Logic
8.1 Navigate to IO Block
Ensure all AI blocks are trained (green status) before proceeding:
- Click "IO Block" in breadcrumb menu, OR
- Select "Configure I/O" from Recipe Editor
8.2 Locate Classification Logic Node
- Find the "Classification Block Logic Node" (purple node)
- If missing: Drag from the nodes menu on the left
Node Colors: Purple nodes represent Overview Logic Blocks for AI operations.
8.3 Configure Classification Logic
- Double-click the Classification Logic Node
- Configure settings:
ROI Selection
- Select your ROI from the "Inspection Region" dropdown
Confidence Threshold
- Set confidence threshold (typically 70-85%)
- Higher threshold = More strict classification
- Lower threshold = More permissive classification
Target Class Selection
- Choose target class for "pass" results
- Example: Select "Medium" if only medium bits should pass
Multiple ROI Logic (Advanced)
- Add more ROIs if needed
- Choose logic: "Any" or "All" rules must pass
8.4 Example Pass/Fail Configurations
Configuration 1: Size-Specific Pass
ROI: Drill_Bit_ROI
Target Class: Medium
Confidence: 80%
Logic: Pass only medium drill bits
Configuration 2: Size Range Pass
ROI: Drill_Bit_ROI
Target Classes: Medium OR Large
Confidence: 75%
Logic: Pass medium or large bits
Configuration 3: Reject Small Bits
ROI: Drill_Bit_ROI
Target Class: NOT Small
Confidence: 85%
Logic: Fail if classified as small
8.5 Deploy Logic Configuration
- Click
Done
in the top-right corner - Click
Deploy
in the top-right corner of Node-RED editor - Verify deployment success message
Step 9: Final Testing and Validation
9.1 End-to-End Testing
Test the complete inspection workflow:
- Place test objects in the inspection area
- Trigger inspection (manual or automatic)
- Verify results:
- Correct classification displayed
- Proper pass/fail indication
- Consistent timing performance
9.2 Production Validation Checklist
Test Case | Expected Result | ✓ |
---|---|---|
Target class object | Pass result | ☐ |
Non-target class object | Fail result | ☐ |
Empty ROI | Fail result | ☐ |
Partially obscured object | Appropriate confidence level | ☐ |
Poor lighting conditions | Consistent performance | ☐ |
9.3 Performance Optimization
If results aren't satisfactory:
- Add more training images (especially edge cases)
- Adjust confidence thresholds
- Improve lighting consistency
- Refine ROI positioning
- Retrain with "Accurate" mode
Congratulations!
You've successfully created your first classification model! Your OV20i system can now:
- Automatically identify different drill bit sizes
- Apply pass/fail logic based on classification results
- Provide confidence scores for each classification
- Integrate with production workflows through I/O controls
Next Steps
Now that you've mastered single-ROI classification, consider exploring:
Advanced Classification Techniques
- Multi-ROI classification for complex parts
- Hierarchical classification for detailed categorization
- Combination inspection (classification + defect detection)
Production Integration
- PLC communication for automated sorting
- Data logging for quality tracking
- Recipe management for multiple product lines
Model Optimization
- Transfer learning for similar products
- Active learning for continuous improvement
- Performance monitoring and retraining schedules
🔗 See Also
Troubleshooting Guide
Common Issues and Solutions
Issue | Symptom | Solution |
---|---|---|
Poor accuracy | Classifications frequently wrong | Add more diverse training images |
Slow performance | Long processing times | Reduce ROI size, optimize lighting |
Inconsistent results | Same object gives different results | Improve part positioning, check focus |
False positives | Empty ROI shows classification | Increase confidence threshold |
Training fails | Model won't train successfully | Check image quality, ensure 5+ images per class |
Getting Help
If you encounter issues not covered in this tutorial:
- Check the troubleshooting guides in the documentation
- Review system logs for error messages
- Contact Overview support with:
- Recipe export file
- Sample images showing the issue
- System configuration details
Tutorial Complete! You now have a working classification system ready for production use. Remember to regularly validate performance and retrain your model as needed to maintain accuracy over time.